package site.luojie.business.user.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import site.luojie.business.user.pojo.AuthUser;

/**
 * @author jie.luo
 * @since 2020/9/17
 */
@Mapper
public interface AuthUserMapper {

    @Insert("INSERT INTO auth_user(email, password, createTime, updateTime) VALUES (#{user.email}, #{user.password}, #{user.createTime}, #{user.updateTime})")
    int insertAuthUser(@Param("user") AuthUser user);

    @Select("select count(1) from auth_user where email = #{email}")
    int countAuthUser(@Param("email") String email);

    @Select("select id,email,password from auth_user where email = #{email}")
    AuthUser selectAuthUser(@Param("email") String email);
}
